using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace NewRen.Models
{
    public class User
    {
        public int ID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Index]
        [StringLength(100)]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 真是姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 微博
        /// </summary>
        public string Weibo { get; set; }

        /// <summary>
        /// 职业
        /// </summary>
        public string Job { get; set; }

        /// <summary>
        /// 自我描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string City { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        public string District { set; get; }

        /// <summary>
        /// 镇
        /// </summary>
        public string Town { set; get; }

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 图像
        /// </summary>
        public byte[] Picture { get; set; }

        /// <summary>
        /// 邮件
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// QQ
        /// </summary>
        public string QQ { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public int SexAsInt { set; get; }

        /// <summary>
        /// 出生年月日
        /// </summary>
        public DateTime? Birthday { get; set; }

        /// <summary>
        /// 积分
        /// </summary>
        public int Integration { get; set; }

        /// <summary>
        /// 金钱
        /// </summary>
        public double Money { get; set; }

        /// <summary>
        /// 访问量
        /// </summary>
        public int PV { get; set; }

        /// <summary>
        /// 今日访问量
        /// </summary>
        public int TodayPV { get; set; }

        /// <summary>
        ///赞
        /// </summary>
        public int Ups { get; set; }

        /// <summary>
        /// 踩
        /// </summary>
        public int Downs { get; set; }

        /// <summary>
        /// 微信
        /// </summary>
        public string WhatApp { get; set; }

        /// <summary>
        /// 增加时间
        /// </summary>
        public DateTime? AddTime { get; set; }

        /// <summary>
        /// 上次登录时间
        /// </summary>
        public DateTime? LastLogin { get; set; }

        /// <summary>
        /// 牛棚，可空
        /// </summary>

        public int? UserGroupID { get; set; }

        /// <summary>
        /// 优先级
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// 是否认证
        /// </summary>
        public bool IsVerified { set; get; }

        [NotMapped]
        public Sex Sex
        {
            set { SexAsInt = (int)value; }
            get { return (Sex)SexAsInt; }
        }

        public bool IsShow { set; get; }

    }
}
